<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/4/17
  Time: 16:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>

<%
String username = request.getParameter("username");
String password = request.getParameter("password");

//判断用户名和密码是否正确
if ("admin".equals(username) && "123456".equals(password)){
    //可以登录

    response.sendRedirect("userList.jsp");

//    out.write("登录成功！");
//    session内置对象定义变量，这个变量所有的jsp页面都可以访问
//    true为变量的值
    session.setAttribute("isLogin","true");

}else{
    out.write("<p>用户名或密码错误</p>");
}
%>


</body>
</html>
